<script setup lang="ts">
import { ref } from "vue";
import type { PropType } from "vue";
interface ImgListItem {
  id: number;
  url: string;
}

type ImgList = ImgListItem[];

const props = defineProps({
  imgList: {
    type: Array as PropType<ImgList>,
    default: () => [
      {
        id: 1,
        url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      },
      {
        id: 2,
        url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      },
      {
        id: 3,
        url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      },
      {
        id: 5,
        url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      },
    ],
  },
});
</script>

<template>
  <div class="Swiper-page">
    <el-carousel
      height="100vh"
      arrow="never"
      indicator-position="none"
      :pause-on-hover="false"
    >
      <el-carousel-item v-for="item in props.imgList" :key="item.id">
        <el-image
          style="width: 100%; height: 100%"
          :src="item.url"
          :fit="'cover'"
        />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<style scoped>
.Swiper-page {
  width: 100%;
  height: 100%;
}

.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
